package symbolClass;

import checkClass.BaseTypeEnum;
import checkClass.TypeExpression;

import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;

/*
    函数/过程基本节点
    2022-3-11-杨海南
 */
public class FunctionNode {

    //函数的唯一限定名
    private String funcName;
    //返回值的类型，只可能为基本数据类型
    private BaseTypeEnum returnType;
    //参数个数
    private int paraNum;
    //函数的参数类型列表
    private TypeExpression[] paraTypeList;
    //按引用传递的参数的下标
    private HashSet<Integer> referIndex;

    public BaseTypeEnum getReturnType() {
        return returnType;
    }

    public TypeExpression[] getParaTypeList() {
        return paraTypeList;
    }

    public int getParaNum() {
        return paraNum;
    }

    public String getFuncName() {
        return funcName;
    }

    public FunctionNode(String funcName, BaseTypeEnum returnType, int paraNum, TypeExpression[] paraTypeList, HashSet<Integer> referIndex) {
        this.funcName = funcName;
        this.returnType = returnType;
        this.paraNum = paraNum;
        this.paraTypeList = paraTypeList;
        this.referIndex = referIndex;
    }

    public HashSet<Integer> getReferIndex() {
        return referIndex;
    }
}
